﻿@model LOMBARDISPICK.Model.LPCoefficient
@using LOMBARDISPICK.Web.Helpers;

@{
	ViewBag.Title = "Index";
}

<script type="text/javascript">
	$(document).ready(function () {
		$("#YearToCalculate").change(function () {
			AjaxGetJSONArray("Prediction", "getDefaultStatsForTeam", $('#NFLTeamsID').val() + "," + $('#YearToCalculate').val());
		});

		$("#NFLTeamsID").change(function () {
			AjaxGetJSONArray("Prediction", "getDefaultStatsForTeam", $('#NFLTeamsID').val() + "," + $('#YearToCalculate').val());
		});

		$("#ShowAdvancedStats").change(function () {
			if ($("#ShowAdvancedStats").val() == "No") {
				$("#AdvancedStats").hide("fast");
			}
			else {
				$("#AdvancedStats").show("fast");
			}
		});

		//Auto load data
		AjaxGetJSONArray("Prediction", "getDefaultStatsForTeam", $('#NFLTeamsID').val() + "," + $('#YearToCalculate').val());

		$("#AdvancedStats").hide();
	});

//catch the JSON returned via AJAX and process it.
function ProcessRetrievedJSON(msg) {
	if (msg[0] != undefined) {
		if (msg[0][0] == "JSON_STATS") {
			$('#EstimatingExtraHours').html('');
			$.each(msg, function () {
				$('#' + $(this)[1]).val($(this)[2]);
			});
		}
	}
}
</script>



<div class="wrapper row1">
  <header id="header">
	<hgroup>
	  <h1>Customize Your Variables</h1>
	</hgroup>
  </header>
</div>

<!-- content -->
<div class="wrapper row2">
	<div id="container">
	<!-- ################################################################################################ -->

<h2>Variables in Calculating Predictions</h2>

@using (Html.BeginForm("Calculate", "CalculateOdds", FormMethod.Post))
{
	<!--@Html.ValidationSummary(true)-->
	<fieldset>
		<legend>Stats</legend>

		<span class="editor-label">
			@Html.LabelFor(model => model.YearToCalculate)
			@Html.RequiredFieldFor(model => model.YearToCalculate)
		</span>
		<div class="editor-field">
			@Html.DropDownList("YearToCalculate")
			@Html.ValidationMessageFor(model => model.YearToCalculate)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.NFLTeamsID)
			@Html.RequiredFieldFor(model => model.NFLTeamsID)
		</span>
		<div class="editor-field">
			@Html.DropDownList("NFLTeamsID")
			@Html.ValidationMessageFor(model => model.NFLTeamsID)
		</div>
		<br />

		<br />
		<span class="editor-label">
			Show Advanced Stats
		</span>
		<div class="editor-field">
			<select name="ShowAdvancedStats" id="ShowAdvancedStats"> 
			  <option value="No" >No</option>
			  <option value="Yes" >Yes</option>
			</select>
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.PasserRating)
			@Html.RequiredFieldFor(model => model.PasserRating)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.PasserRating)
			@Html.ValidationMessageFor(model => model.PasserRating)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.PointsPerGameDefense)
			@Html.RequiredFieldFor(model => model.PointsPerGameDefense)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.PointsPerGameDefense)
			@Html.ValidationMessageFor(model => model.PointsPerGameDefense)
		</div>
		<br />
		
		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.PointsPerGameOffense)
			@Html.RequiredFieldFor(model => model.PointsPerGameOffense)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.PointsPerGameOffense)
			@Html.ValidationMessageFor(model => model.PointsPerGameOffense)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.redZonePercentageDefense)
			@Html.RequiredFieldFor(model => model.redZonePercentageDefense)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.redZonePercentageDefense)
			@Html.ValidationMessageFor(model => model.redZonePercentageDefense)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.redzonePercentageOffense)
			@Html.RequiredFieldFor(model => model.redzonePercentageOffense)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.redzonePercentageOffense)
			@Html.ValidationMessageFor(model => model.redzonePercentageOffense)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.TurnoverDifferential)
			@Html.RequiredFieldFor(model => model.TurnoverDifferential)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.TurnoverDifferential)
			@Html.ValidationMessageFor(model => model.TurnoverDifferential)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.TimeOfPosession)
			@Html.RequiredFieldFor(model => model.TimeOfPosession)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.TimeOfPosession)
			@Html.ValidationMessageFor(model => model.TimeOfPosession)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.PassingYardsPerAttempt)
			@Html.RequiredFieldFor(model => model.PassingYardsPerAttempt)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.PassingYardsPerAttempt)
			@Html.ValidationMessageFor(model => model.PassingYardsPerAttempt)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.ThirdDownPercentage)
			@Html.RequiredFieldFor(model => model.ThirdDownPercentage)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.ThirdDownPercentage)
			@Html.ValidationMessageFor(model => model.ThirdDownPercentage)
		</div>
		<br />

		<div id="AdvancedStats">

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.FourthDownPercentage)
			@Html.RequiredFieldFor(model => model.FourthDownPercentage)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.FourthDownPercentage)
			@Html.ValidationMessageFor(model => model.FourthDownPercentage)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.Penalties)
			@Html.RequiredFieldFor(model => model.Penalties)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.Penalties)
			@Html.ValidationMessageFor(model => model.Penalties)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.PenaltyYards)
			@Html.RequiredFieldFor(model => model.PenaltyYards)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.PenaltyYards)
			@Html.ValidationMessageFor(model => model.PenaltyYards)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.TimesSacked)
			@Html.RequiredFieldFor(model => model.TimesSacked)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.TimesSacked)
			@Html.ValidationMessageFor(model => model.TimesSacked)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.TimesSackedYards)
			@Html.RequiredFieldFor(model => model.TimesSackedYards)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.TimesSackedYards)
			@Html.ValidationMessageFor(model => model.TimesSackedYards)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.QuarterbackHits)
			@Html.RequiredFieldFor(model => model.QuarterbackHits)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.QuarterbackHits)
			@Html.ValidationMessageFor(model => model.QuarterbackHits)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.OpponentTimeOfPosession)
			@Html.RequiredFieldFor(model => model.OpponentTimeOfPosession)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.OpponentTimeOfPosession)
			@Html.ValidationMessageFor(model => model.OpponentTimeOfPosession)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.OpponentPassingYardsPerAttempt)
			@Html.RequiredFieldFor(model => model.OpponentPassingYardsPerAttempt)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.OpponentPassingYardsPerAttempt)
			@Html.ValidationMessageFor(model => model.OpponentPassingYardsPerAttempt)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.OpponentPasserRating)
			@Html.RequiredFieldFor(model => model.OpponentPasserRating)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.OpponentPasserRating)
			@Html.ValidationMessageFor(model => model.OpponentPasserRating)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.OpponentThirdDownPercentage)
			@Html.RequiredFieldFor(model => model.OpponentThirdDownPercentage)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.OpponentThirdDownPercentage)
			@Html.ValidationMessageFor(model => model.OpponentThirdDownPercentage)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.OpponentFourthDownPercentage)
			@Html.RequiredFieldFor(model => model.OpponentFourthDownPercentage)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.OpponentFourthDownPercentage)
			@Html.ValidationMessageFor(model => model.OpponentFourthDownPercentage)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.OpponentPenalties)
			@Html.RequiredFieldFor(model => model.OpponentPenalties)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.OpponentPenalties)
			@Html.ValidationMessageFor(model => model.OpponentPenalties)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.OpponentPenaltyYards)
			@Html.RequiredFieldFor(model => model.OpponentPenaltyYards)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.OpponentPenaltyYards)
			@Html.ValidationMessageFor(model => model.OpponentPenaltyYards)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.OpponentTimesSacked)
			@Html.RequiredFieldFor(model => model.OpponentTimesSacked)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.OpponentTimesSacked)
			@Html.ValidationMessageFor(model => model.OpponentTimesSacked)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.OpponentTimesSackedYards)
			@Html.RequiredFieldFor(model => model.OpponentTimesSackedYards)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.OpponentTimesSackedYards)
			@Html.ValidationMessageFor(model => model.OpponentTimesSackedYards)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.Punts)
			@Html.RequiredFieldFor(model => model.Punts)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.Punts)
			@Html.ValidationMessageFor(model => model.Punts)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.OpponentPunts)
			@Html.RequiredFieldFor(model => model.OpponentPunts)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.OpponentPunts)
			@Html.ValidationMessageFor(model => model.OpponentPunts)
		</div>
		<br />

		<br />
		<span class="editor-label">
			@Html.LabelFor(model => model.OpponentTurnoverDifferential)
			@Html.RequiredFieldFor(model => model.OpponentTurnoverDifferential)
		</span>
		<div class="editor-field">
			@Html.EditorFor(model => model.OpponentTurnoverDifferential)
			@Html.ValidationMessageFor(model => model.OpponentTurnoverDifferential)
		</div>
		<br />

		</div>

		<br />
		<p>
			<input type="submit" value="Calculate" class="button" />
		</p>

	</fieldset>
}

	<!-- ################################################################################################ -->
	<div class="clear"></div>
	</div>
</div>